﻿Public Class Rcolor

    'Public Shared Function SeleccionarTodo(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean) As List(Of Ecolor)
    '    Dim colores As List(Of Ecolor) = Nothing

    '    Dim options As New TransactionOptions
    '    options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
    '    options.Timeout = New TimeSpan(0, 2, 0)

    '    Using scope As New TransactionScope(TransactionScopeOption.Required, options)
    '        Try
    '            colores = Dcolor.SeleccionarTodo(descEmpresa)
    '            If colores Is Nothing Then colores = New List(Of Ecolor)
    '            If DisplaySelect Then colores.Insert(0, New Ecolor("00", "-- SELECCIONAR --"))
    '            scope.Complete()
    '        Catch ex As Exception
    '            Throw
    '        End Try
    '    End Using

    '    Return colores
    'End Function
    Public Shared Function SeleccionarXEstado(ByVal descEmpresa As String, ByVal DisplaySelect As Boolean) As List(Of Ecolor)
        Dim colores As List(Of Ecolor) = Nothing

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                colores = Dcolor.SeleccionarXEstado(descEmpresa)
                If colores Is Nothing Then colores = New List(Of Ecolor)
                If DisplaySelect Then colores.Insert(0, New Ecolor("00", "-- SELECCIONAR --"))
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return colores
    End Function
    'Public Shared Function Añadir(ByVal descEmpresa As String, ByVal pCorredora As Ecolor) As Boolean
    '    Dim resultado As Boolean = False

    '    Dim options As New TransactionOptions
    '    options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
    '    options.Timeout = New TimeSpan(0, 2, 0)

    '    Using scope As New TransactionScope(TransactionScopeOption.Required, options)
    '        Try
    '            resultado = Dcolor.Añadir(descEmpresa, pCorredora)
    '            scope.Complete()
    '        Catch ex As Exception
    '            Throw
    '        End Try
    '    End Using

    '    Return resultado
    'End Function
    'Public Shared Function Editar(ByVal descEmpresa As String, ByVal pCorredora As Ecolor) As Boolean
    '    Dim resultado As Boolean = False

    '    Dim options As New TransactionOptions
    '    options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
    '    options.Timeout = New TimeSpan(0, 2, 0)

    '    Using scope As New TransactionScope(TransactionScopeOption.Required, options)
    '        Try
    '            resultado = Dcolor.Editar(descEmpresa, pCorredora)
    '            scope.Complete()
    '        Catch ex As Exception
    '            Throw
    '        End Try
    '    End Using

    '    Return resultado
    'End Function
    Public Shared Function Eliminar(ByVal descEmpresa As String, ByVal pCorredora As Ecolor) As Boolean
        Dim resultado As Boolean = False

        Dim options As New TransactionOptions
        options.IsolationLevel = Transactions.IsolationLevel.ReadCommitted
        options.Timeout = New TimeSpan(0, 2, 0)

        Using scope As New TransactionScope(TransactionScopeOption.Required, options)
            Try
                resultado = Dcolor.Eliminar(descEmpresa, pCorredora)
                scope.Complete()
            Catch ex As Exception
                Throw
            End Try
        End Using

        Return resultado
    End Function

End Class
